/* 
    好友验证集合
*/
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
import mongoose, { Document } from 'mongoose'

export type friendVerifyDocument = FriendVerify & Document

@Schema({ timestamps: true })
class FriendVerify {
  //添加者
  @Prop({ required: true, ref: 'User' })
  user: mongoose.Types.ObjectId
  //被添加者
  @Prop({ required: true, ref: 'User' })
  friend: mongoose.Types.ObjectId
  //是否同意
  @Prop({ default: false })
  agree: boolean
  //是否已读
}

const friendVerifySchema = SchemaFactory.createForClass(FriendVerify)

export { FriendVerify, friendVerifySchema }
